//获取
//dXNlcl9uYW1lOnBhc3N3b3Jk = user_name:password
const args = process.argv.slice(2)

// 检查命令行参数是否正确
if (args.length !== 1) {
  console.error('命令行参数不正确，正确的格式是：cmd base64_string');
  process.exit(1);
}

const base64Args = args[0]
console.log('base64:', base64Args);

//将 base64 编码的字符串转换成 utf8 编码的字符串
const newArgs1 = Buffer.from(base64Args, 'base64').toString('utf8')
console.log('case1 uft8:', newArgs1);
const newArgs2 = Buffer.from(base64Args, 'base64').toString()
console.log('case2 uft8:', newArgs2);
